package com.example.mall.goods.api.service;


import com.example.mall.goods.api.entity.MallGoods;
import com.example.mall.util.PageQueryUtil;
import com.example.mall.util.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "mall-goods-core")
public interface ShopGoodsService {

    @PostMapping("/shopGoods/getShopGoodsPage")
    PageResult getShopGoodsPage(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/shopGoods/saveShopGoods")
    String saveShopGoods(@RequestBody MallGoods goods);

    @PostMapping("/shopGoods/batchSaveShopGoods")
    void batchSaveShopGoods(@RequestBody List<MallGoods> mallGoodsList);

    @PostMapping("/shopGoods/updateShopGoods")
    String updateShopGoods(@RequestBody MallGoods goods);

    @PostMapping("/shopGoods/getShopGoodsById")
    MallGoods getShopGoodsById(@RequestParam("id") Long id);

    @PostMapping("/shopGoods/batchUpdateSellStatus")
    Boolean batchUpdateSellStatus(@RequestParam("ids") Long[] ids,
                                  @RequestParam("sellStatus") int sellStatus);

    @PostMapping("/shopGoods/searchShopGoods")
    PageResult searchShopGoods(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/shopGoods/selectByPrimaryKeys")
    List<MallGoods> selectByPrimaryKeys(@RequestBody List<Long> goodsIds);
}
